﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/Management.master" AutoEventWireup="true"
    CodeFile="Company_Monthly.aspx.cs" Inherits="Management_Company_Monthly" %>

<%@ Import Namespace="Avatar.Company" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table>
        <tr>
            <td style="vertical-align: top;">
                <div class="Dialog">
                    <div class="Title">
                        包月用户列表</div>
                    <div class="Content">
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                            CellPadding="4" DataKeyNames="Company" DataSourceID="SqlDataSource1" ForeColor="#333333"
                            GridLines="None" PageSize="20">
                            <RowStyle BackColor="#EFF3FB" />
                            <Columns>
                                <asp:TemplateField HeaderText="公司帐号">
                                    <ItemTemplate>
                                        <%# Eval("Company") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="公司名称">
                                    <ItemTemplate>
                                        <%# CompanyInformationManager.GetCompanyInformation(Eval("Company").ToString()) == null ? "资料未填" : CompanyInformationManager.GetCompanyInformation(Eval("Company").ToString()).CompanyName%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="到期日期">
                                    <ItemTemplate>
                                        <%# ExpirationDateManager.GetExpirationDate(Eval("Company").ToString())%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="操作">
                                    <ItemTemplate>
                                        <asp:Button ID="btn_ExpirationDate" runat="server" Text="到期时间" OnClick="btn_ExpirationDate_Click"
                                            CommandArgument='<%# Eval("Company") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AvatarConnectionString %>"
                            SelectCommand="SELECT [ServiceTypeID], [Company] FROM [CompanyService] WHERE ([ServiceTypeID] = @ServiceTypeID)">
                            <SelectParameters>
                                <asp:Parameter DefaultValue="3" Name="ServiceTypeID" Type="Int32" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>
                </div>
                <b>注意:</b>如“到期日期”为红色字体则说明该用户即将到期或者已经到期，请与其取得联系续费延期。
            </td>
            <td style="vertical-align: top;">
                <asp:Panel ID="panel_Date" runat="server">
                    <div class="Dialog" style="width: 300px;">
                        <div class="Title">
                            <table width="100%">
                                <tr>
                                    <td>
                                        选择到期日期
                                    </td>
                                    <td style="text-align: right;">
                                        <asp:LinkButton ID="btn_Cancel" runat="server">X</asp:LinkButton>&nbsp;
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="Content">
                            到期日期:<asp:TextBox ID="txt_ExDate" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txt_ExDate"
                                Display="Dynamic" ErrorMessage="*" ValidationGroup="Date"></asp:RequiredFieldValidator>
                            &nbsp;<asp:HiddenField ID="txt_Company" runat="server" />
                            <asp:Button ID="btn_Set" runat="server" Text="保存" CssClass="Button" OnClick="btn_Set_Click"
                                ValidationGroup="Date" />
                            <ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="保存后无法还原，确定保存吗？"
                                TargetControlID="btn_Set">
                            </ajaxToolkit:ConfirmButtonExtender>
                            <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txt_ExDate">
                            </ajaxToolkit:CalendarExtender>
                        </div>
                    </div>
                </asp:Panel>
                <asp:Label ID="lbl_Error" ForeColor="Red" EnableViewState="false" runat="server" />
            </td>
        </tr>
    </table>
</asp:Content>
